d natural numbers. How to solve this quickly and logically